home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  5.3 KB  |  212 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Processes.p
  3.  
  4.      Contains:    Process Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Processes;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __PROCESSES__}
  30. {$SETC __PROCESSES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ProcessesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __EVENTS__}
  43. {$I Events.p}
  44. {$ENDC}
  45. {    Quickdraw.p                                                    }
  46. {        MixedMode.p                                                }
  47. {        QuickdrawText.p                                            }
  48. {    OSUtils.p                                                    }
  49. {        Memory.p                                                }
  50.  
  51. {$IFC UNDEFINED __FILES__}
  52. {$I Files.p}
  53. {$ENDC}
  54.  
  55. {$PUSH}
  56. {$ALIGN MAC68K}
  57. {$LibExport+}
  58.  
  59. TYPE
  60.     ProcessSerialNumber = RECORD
  61.         highLongOfPSN:            LONGINT;
  62.         lowLongOfPSN:            LONGINT;
  63.     END;
  64.  
  65.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  66.  
  67.  
  68. CONST
  69. { Process identifier - Various reserved process serial numbers }
  70.     kNoProcess                    = 0;
  71.     kSystemProcess                = 1;
  72.     kCurrentProcess                = 2;
  73.  
  74. { Definition of the parameter block passed to _Launch
  75.     Typedef and flags for launchControlFlags field }
  76.     
  77. TYPE
  78.     LaunchFlags = INTEGER;
  79.  
  80.  
  81. CONST
  82. { Definition of the parameter block passed to _Launch }
  83.     launchContinue                = $4000;
  84.     launchNoFileFlags            = $0800;
  85.     launchUseMinimum            = $0400;
  86.     launchDontSwitch            = $0200;
  87.     launchAllow24Bit            = $0100;
  88.     launchInhibitDaemon            = $0080;
  89.  
  90. { Format for first AppleEvent to pass to new process.  The size of the overall
  91.   buffer variable: the message body immediately follows the messageLength }
  92.  
  93. TYPE
  94.     AppParameters = RECORD
  95.         theMsgEvent:            EventRecord;
  96.         eventRefCon:            LONGINT;
  97.         messageLength:            LONGINT;
  98.     END;
  99.  
  100.     AppParametersPtr = ^AppParameters;
  101.  
  102. { Parameter block to _Launch }
  103.     LaunchParamBlockRec = RECORD
  104.         reserved1:                LONGINT;
  105.         reserved2:                INTEGER;
  106.         launchBlockID:            INTEGER;
  107.         launchEPBLength:        LONGINT;
  108.         launchFileFlags:        INTEGER;
  109.         launchControlFlags:        LaunchFlags;
  110.         launchAppSpec:            FSSpecPtr;
  111.         launchProcessSN:        ProcessSerialNumber;
  112.         launchPreferredSize:    LONGINT;
  113.         launchMinimumSize:        LONGINT;
  114.         launchAvailableSize:    LONGINT;
  115.         launchAppParameters:    AppParametersPtr;
  116.     END;
  117.  
  118.     LaunchPBPtr = ^LaunchParamBlockRec;
  119.  
  120. { Set launchBlockID to extendedBlock to specify that extensions exist.
  121.  Set launchEPBLength to extendedBlockLen for compatibility.}
  122.  
  123. CONST
  124.     extendedBlock                = $4C43;                        { 'LC' }
  125.     extendedBlockLen            = 32;                            { sizeof(LaunchParamBlockRec) - 12 }
  126.  
  127. { Definition of the information block returned by GetProcessInformation }
  128.     modeDeskAccessory            = $00020000;
  129.     modeMultiLaunch                = $00010000;
  130.     modeNeedSuspendResume        = $00004000;
  131.     modeCanBackground            = $00001000;
  132.     modeDoesActivateOnFGSwitch    = $00000800;
  133.     modeOnlyBackground            = $00000400;
  134.     modeGetFrontClicks            = $00000200;
  135.     modeGetAppDiedMsg            = $00000100;
  136.     mode32BitCompatible            = $00000080;
  137.     modeHighLevelEventAware        = $00000040;
  138.     modeLocalAndRemoteHLEvents    = $00000020;
  139.     modeStationeryAware            = $00000010;
  140.     modeUseTextEditServices        = $00000008;
  141.     modeDisplayManagerAware        = $00000004;
  142.  
  143. { Record returned by GetProcessInformation }
  144.  
  145. TYPE
  146.     ProcessInfoRec = RECORD
  147.         processInfoLength:        LONGINT;
  148.         processName:            StringPtr;
  149.         processNumber:            ProcessSerialNumber;
  150.         processType:            LONGINT;
  151.         processSignature:        OSType;
  152.         processMode:            LONGINT;
  153.         processLocation:        Ptr;
  154.         processSize:            LONGINT;
  155.         processFreeMem:            LONGINT;
  156.         processLauncher:        ProcessSerialNumber;
  157.         processLaunchDate:        LONGINT;
  158.         processActiveTime:        LONGINT;
  159.         processAppSpec:            FSSpecPtr;
  160.     END;
  161.  
  162.     ProcessInfoRecPtr = ^ProcessInfoRec;
  163.  
  164.  
  165. FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
  166.     {$IFC NOT GENERATINGCFM}
  167.     INLINE $205F, $A9F2, $3E80;
  168.     {$ENDC}
  169. FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: ConstStr255Param): OSErr;
  170.     {$IFC NOT GENERATINGCFM}
  171.     INLINE $3F3C, $0036, $A88F;
  172.     {$ENDC}
  173. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  174.     {$IFC NOT GENERATINGCFM}
  175.     INLINE $3F3C, $0037, $A88F;
  176.     {$ENDC}
  177. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  178.     {$IFC NOT GENERATINGCFM}
  179.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  180.     {$ENDC}
  181. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  182.     {$IFC NOT GENERATINGCFM}
  183.     INLINE $3F3C, $0038, $A88F;
  184.     {$ENDC}
  185. FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  186.     {$IFC NOT GENERATINGCFM}
  187.     INLINE $3F3C, $003A, $A88F;
  188.     {$ENDC}
  189. FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  190.     {$IFC NOT GENERATINGCFM}
  191.     INLINE $3F3C, $003B, $A88F;
  192.     {$ENDC}
  193. FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  194.     {$IFC NOT GENERATINGCFM}
  195.     INLINE $3F3C, $003C, $A88F;
  196.     {$ENDC}
  197. FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  198.     {$IFC NOT GENERATINGCFM}
  199.     INLINE $3F3C, $003D, $A88F;
  200.     {$ENDC}
  201.  
  202. {$ALIGN RESET}
  203. {$POP}
  204.  
  205. {$SETC UsingIncludes := ProcessesIncludes}
  206.  
  207. {$ENDC} {__PROCESSES__}
  208.  
  209. {$IFC NOT UsingIncludes}
  210.  END.
  211. {$ENDC}
  212.